<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue数据绑定</title>
    <script src="https://cdn.bootcss.com/vue/2.6.11/vue.js"></script>

</head>

<body>
    <div id="app">
        <h3>姓名:{{name}}</h3>
        <hr>
        <h3>姓名:{{user.name}}</h3>
        <h3>年龄:{{user.age}}</h3>
        <hr>
        <ul>
            <li v-for="(user, index) in List" :key="index">
                姓名:{{user.name}} 年龄：{{user.age}} key:{{index}}
            </li>
        </ul>
    </div>

</body>
<script>
    let app = new Vue({
        el: "#app",

        data() {
            return {
                name: "sw",
                user: {
                    name: "洪潇涵",
                    age: "10"
                },

                List: [{
                    name: "洪潇涵",
                    age: "10"
                }, {
                    name: "洪潇涵",
                    age: "10"
                }, {
                    name: "洪潇涵",
                    age: "10"
                }]
            }
        },

    })
</script>

</html>